//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年2月11日   下午12:03:56
 */
package edu.chinasoft.listen02;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

//关于 ServeltContext生命周期的监听器
public class ServletContextListenerImp implements ServletContextListener{
	private Logger logger = Logger.getLogger(ServletContextAttributeListenerImp.class);
	//serveltcontext对象销毁事件触发时
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		// TODO Auto-generated method stub
		logger.debug("ServletContextListenerImp>>contextDestroyed  start……");
		logger.info("serveltcontext对象("+arg0.getServletContext()+")删除");
		logger.debug("ServletContextListenerImp>>contextDestroyed  end……");

	}
	//serveltcontext对象创建事件触发时
	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		// TODO Auto-generated method stub
		logger.debug("ServletContextListenerImp>>contextInitialized  start……");
		logger.info("serveltcontext对象("+arg0.getServletContext()+")创建");
		logger.debug("ServletContextListenerImp>>contextInitialized  end……");

	}

}
